<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>多图表</title>
    <script src="./js/echarts.js"></script>
    <style>
      #chart {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <div id="chart"></div>
  </body>
  <script>
    const chart = echarts.init(document.getElementById('chart'))
    const options = {
      title: {
        text: '标题'
      },
      xAxis: {
        data: ['一季度', '二季度', '三季度', '四季度']
      },
      yAxis: {}, // 默认有
      series: [
        {
          type: 'pie', // 饼图
          center: ['50%', 80], // 位置 x y轴圆心位置
          radius: 40, // 半径
          data: [
            { name: '1', value: 50 },
            { name: '2', value: 50 },
            { name: '3', value: 50 },
            { name: '4', value: 50 }
          ]
        },
        {
          type: 'line', // 折线图
          data: [60, 70, 65, 80],
          smooth: true // 平滑曲线
        },

        {
          type: 'bar',
          data: [30, 35, 40, 100],
          barWidth: '50%'
        }
      ]
    }
    chart.setOption(options)
  </script>
</html>
